﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DCH.Areas.Admin.Models;
using DCH.Models;

namespace DCH.Controllers
{
    public class EventController : Controller
    {
        private DbConnection db = new DbConnection();

        //
        // GET: /Event/

        public ActionResult Index()
        {
            return View(db.New.ToList());
        }

        //
        // GET: /Event/Details/5

        public ActionResult Details(int id = 0)
        {
            News news = db.New.Find(id);
            if (news == null)
            {
                return HttpNotFound();
            }
            return View(news);
        }

       

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}